<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>	
<%@ include file="/pub/headmeta.jsp" %>
</head>
<body class="edit-bgr-color">
	<div class="right-head"><span class="right-head-font">个人密码修改</span></div>
	<div align="center" style="width: 98%">	
		<form id="editForm" method="post">	
			<table cellpadding="5" style="width: 350px; font-size: 12px;">				
				<tr>
					<td align="right" width="120px">原密码：</td>
					<td><input type="password" name="oldPwd" id="oldPwd" style="width: 80%"/>&nbsp;&nbsp;<font color='red'>*</font></td>					
				</tr>				
				<tr>
					<td align="right">新密码：</td>
					<td><input type="password" name="newPwd"  id="newPwd" style="width: 80%"/>&nbsp;&nbsp;<font color='red'>*</font></td>					
				</tr>
				<tr>
					<td align="right">确认密码：</td>
					<td><input type="password" name="checkPwd"  id="checkPwd" style="width: 80%"/>&nbsp;&nbsp;<font color='red'>*</font></td>					
				</tr>				
			</table>
			<div class="edit-line"></div>
			<input  type="button" class="button-1" value="修改" onclick="doEdit();"/>
			<input  type="button" class="button-1" value="重置" onclick="resetEx(this.form);"/>						
		</form>
	</div>
</body>
</html>
<script type="text/javascript">
<!--
//修改
function doEdit() {	
	if ($("#oldPwd").val() == ""){
		alert('原密码不能为空！');
		return;
	}	
	if ($("#newPwd").val() == ""){
		alert('新密码不能为空！');
		return;
	}
	if ($("#newPwd").val().length<6){
		alert('新密码长度至少6位！');
		return;
	}
	if ($("#newPwd").val() != $("#checkPwd").val()) {
		alert('新密码和确认密码不一致！');
		return;
	}
	var url="${ctx}/user!personResetPwd.action";
	$.post(url, $("#editForm").serialize() ,function callback(txt){   
			var json = $.parseJSON(txt);
			if (json.code==0) {	
				alert('修改密码成功！');				
			}else{
				alert('旧密码不正确，修改密码失败！');
			}
		}	
	);
}
//-->
</script>
